﻿<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
	xmlns:xlink="http://www.w3.org/1999/xlink"
	exclude-result-prefixes="msxsl">

	<xsl:output media-type="text/plain" method="text" indent="yes" encoding="utf-8" />
<xsl:template match="/">
	
<xsl:apply-templates select="AssemblyDifference" />

</xsl:template>

<xsl:template match="AssemblyDifference">

<topic>
<xsl:attribute name="id"><xsl:value-of select="@ID" /></xsl:attribute>
<xsl:attribute name="revisionNumber">1</xsl:attribute>

	<xsl:text disable-output-escaping="yes"><![CDATA[<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">]]></xsl:text>

		<section>
		<xsl:attribute name="address">Introduction</xsl:attribute>
			<title>Assembly <xsl:value-of select="@Name" /></title>
			<content>
				<para>From <xsl:value-of select="@From" /> to <xsl:value-of select="@To" /></para>
			</content>
		</section>

		<!-- link back to summary -->

		<xsl:apply-templates select="RemovedTypes"/>

		<xsl:apply-templates select="ObsoleteTypes"/>

		<xsl:apply-templates select="ChangedTypes"/>

		<xsl:apply-templates select="AddedTypes"/>

		<!-- navigation -->
		<section>
			<content>
				<para>
					<link>
						<xsl:attribute name="xlink:href"><xsl:value-of select="@SummaryID" />
						</xsl:attribute><xsl:value-of select="@SummaryName" />
					</link>
				</para>
			</content>
		</section>

		<!-- link back to summary -->
	<xsl:text disable-output-escaping="yes"><![CDATA[</developerConceptualDocument>]]></xsl:text>

</topic>

</xsl:template>

<xsl:template match="AddedTypes">

<section>
<xsl:attribute name="address">AddedTypes</xsl:attribute>
	<title>Added Types</title>
	<content>
		<table>
			<title>Added Types</title>
			<tableHeader><row><entry><para>Type</para></entry></row></tableHeader>

			<xsl:for-each select="Type">
				<!-- link to T: ...-->
				<row><entry><para>
					<codeEntityReference><xsl:attribute name="qualifyHint">true</xsl:attribute>T:<xsl:value-of select="@Namespace" />.<xsl:value-of select="@Name" /></codeEntityReference>
				</para></entry></row>
			</xsl:for-each>

		</table>
	</content>
</section>

</xsl:template>

<xsl:template match="ObsoleteTypes">

<section>
<xsl:attribute name="address">ObsoleteTypes</xsl:attribute>
	<title>Obsolete Types</title>
	<content>
		<table>
			<title>Obsolete Types</title>
			<tableHeader><row><entry><para>Type</para></entry><entry><para>Message</para></entry></row></tableHeader>

			<xsl:for-each select="Type">
				<!-- link to T: ...-->
			<row>
				<entry><para><codeEntityReference><xsl:attribute name="qualifyHint">true</xsl:attribute>T:<xsl:value-of select="@FullName" /></codeEntityReference></para></entry>
				<entry><para><xsl:value-of select="@Message" /></para></entry>
			</row>
			</xsl:for-each>

		</table>
	</content>
</section>

</xsl:template>

<xsl:template match="ChangedTypes">

<section>
<xsl:attribute name="address">ChangedTypes</xsl:attribute>
	<title>Changed Types</title>
	<content>
		<table>
			<title>Changed Types</title>
			<tableHeader><row><entry><para>Type</para></entry><entry><para>Documentation</para></entry></row></tableHeader>

			<xsl:for-each select="TypeNameReference">
				<!-- link to child report -->
				<row>
					<entry><para><link><xsl:attribute name="xlink:href"><xsl:value-of select="@ID" /></xsl:attribute><xsl:value-of select="@TypeName" /></link></para></entry>
					<entry><para><codeEntityReference><xsl:attribute name="qualifyHint">true</xsl:attribute>T:<xsl:value-of select="@TypeName" /></codeEntityReference></para></entry>
				</row>
			</xsl:for-each>

		</table>
	</content>
</section>

</xsl:template>

<xsl:template match="RemovedTypes">

<section>
<xsl:attribute name="address">RemovedTypes</xsl:attribute>
	<title>Removed Types</title>
	<content>
		<table>
			<title>Removed Types</title>
			<tableHeader><row><entry><para>Type</para></entry></row></tableHeader>

			<xsl:for-each select="Type">
				<row><entry><para><xsl:value-of select="@FullName" /></para></entry></row>
			</xsl:for-each>

		</table>
	</content>
</section>

</xsl:template>

</xsl:stylesheet>
